﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Marmat.Foundation
{
    /// <summary>
    /// 报表对象定义的标准。
    /// </summary>
    public interface IReportObject
    {

        /// <summary>
        /// 获取报表的名称。
        /// </summary>
        string Name { get; }

        /// <summary>
        /// 根据名称加载报表
        /// </summary>
        /// <param name="name">报表的名称。</param>
        void Load(string name);

        /// <summary>
        /// 注册数据
        /// </summary>
        /// <param name="data">数据</param>
        void RegisterData(System.Data.DataSet data);

        /// <summary>
        /// 注册数据
        /// </summary>
        /// <param name="data">数据</param>
        /// <param name="name">名称</param>
        void RegisterData(DataSet data, string name);

        /// <summary>
        /// 注册数据
        /// </summary>
        /// <param name="data">数据</param>
        /// <param name="name">名称</param>
        void RegisterData(DataTable data, string name);

        /// <summary>
        /// 注册数据
        /// </summary>
        /// <param name="data">数据</param>
        /// <param name="name">名称</param>
        void RegisterData(IEnumerable data, string name);

        /// <summary>
        /// 设置参数值
        /// </summary>
        /// <param name="complexName">参数名称</param>
        /// <param name="value">参数值</param>
        void SetParameterValue(string complexName, object value);

        /// <summary>
        /// 获取参数值。
        /// </summary>
        /// <param name="complexName">参数名称</param>
        /// <returns></returns>
        object GetParameterValue(string complexName);

        /// <summary>
        /// 打开预览界面
        /// </summary>
        void Prepare();

        /// <summary>
        /// 打印报表
        /// </summary>
        void Print();

        /// <summary>
        /// 打开设计界面
        /// </summary>
        void Design();

        /// <summary>
        /// 保存报表模板。
        /// </summary>
        void Save();
    }
}
